import type { App } from 'vue'
import { defineAsyncComponent } from 'vue'
// import { Icon } from './Icon'
// import { Permission } from './Permission'
// import { BaseButton } from './Button'
// import { Pagination } from './Pagination'
// import { SvgIcon } from './SvgIcon'

const components = {
  Icon: ()=> import('./Icon/src/Icon.vue'),
  Permission: ()=> import('./Permission/src/Permission.vue'),
  BaseButton: ()=> import('./Button/src/Button.vue'),
  Pagination: ()=> import('./Pagination/src/index.vue'),
  SvgIcon: ()=> import('./SvgIcon/src/index.vue')
}

export const setupGlobCom = (app: App<Element>): void => {
  Object.keys(components).forEach((key) => {
    app.component(key, defineAsyncComponent(components[key]))
  })
}
